# nested_components.py

from __future__ import division

from ot_simulator.component import component
from ot_simulator import setup

class nested_components(component.component):
    '''This effectively splices its stack into it's parent's stack.

    ===============  ==========================
     Input setting   
    ===============  ==========================
    <none>
    ===============  ==========================

    ===============  ==========================
    Output setting
    ===============  ==========================
    <none> 
    ===============  ==========================
    '''

    def __init__(self, *stack, **kws):
        component.component.__init__(self, **kws)
        self.stack = stack

    def register(self, params):
        super(nested_component, self).register(params)
        setup.register_stack(self.stack, params)

    def get_transform(self, params, transform_in):
        return setup.simulate_stack(self.stack, params, transform_in)

